home *** CD-ROM | disk | FTP | other *** search
-
- The Script Language Manual Page 1
-
-
-
-
-
-
-
- _______
- ____|__ | (R)
- --| | |-------------------
- | ____|__ | Association of
- | | |_| Shareware
- |__| o | Professionals
- -----| | |---------------------
- |___|___| Member
-
-
-
-
-
-
-
- Table of Contents Page #
-
- 1 Introduction 1
- 2 A script language sample
- 3 THE LANGUAGE 2
- BATCH
- BEEP 3
- BROWSE
- CD or CHDIR
- DELAY(seconds)
- DONE (or END)
- DOS_MENU
- ECHO
- END
- ENDBATCH
- ENDLIST
- EQUIPMENT
- ERASE
- GET
- GETTEXT 4
- GETLIST
- LOOP
- MACROS 5
- MKDIR
- MODEM_XXX
- NOCLS or NOCLEAR
- NOSWAP 6
- PASSWORD
- PAUSE or WAIT
- QUIT
- QUIT_TO
- RAM
- REM or #
- RUN
- TEXT
-
-
-
-
- The Script Language Manual Page 2
-
- TIME
- WAIT
- $(macro) 7
- 4 XBASE language maintenance commands
- DBF_DELETE
- DBF_PACK
- DBF_RECALL
- DBF_RECCOUNT
- DBF_RECNO
- DBF_STRUCTURE
- DBF_ZAP
- 5 General notes and Warranty 7
-
-
-
- 1 Introduction
-
- The TeleShare Phone, or TSPHONE, system has a built in DOS
- menu program that uses the script language, as does the Open
- Menu.
-
-
- 2 A script language sample:
-
- For example, using Word Perfect's WP.exe. The description
- could be WordPerf and the action could be as follows.
-
- REMark to run Word Perfect 6
- CHDIR \WP6 # change to the directory
- WP GET NOCLEAR # run WP after swapping out.
-
- CHDIR changes to the \WP6 directory. WP runs Word Perfect
- without pre-clearing (NOCLEAR) the screen. The 'GET' is the
- parameter. In this case the program will ask you for a file
- name, such as 'myletter' and then feed your response as a
- parameter or filename to WP. After using Word Perfect the
- program will automatically return both you and it to its
- 'home' or start up directory. Its a good idea to review the
- existing examples in the main program.
-
- 3 THE LANGUAGE
-
- The following material is a basic description of the
- language. It is a good idea to peruse the language used in
- the included samples. The xbase commands are given in a
- separate area following the rest. When the program is run by
- another program, as in "TSPHONE -N12" to run entry # 12 the
- interactive commands (like BROWSE) are disabled with the idea
- that other software does not want interactive use. However,
- you can use the -A- command line switch to disable this
- behaviour for tutorials and the like. Study the examples,
- learning by example is good stuff.
-
-
- BATCH indicates the start of an encapsulated batch file.
- Batch files can be stored inside the script entries and run as
-
-
-
-
- The Script Language Manual Page 3
-
- needed. By default they remain on disk after use, so you need
- to erase them after each use. To create and run the batch
- file on disk you need to provide its name as in:
-
- # Not an especially fancy batch file, but its easy to see
- # how to set one up.
- BATCH TEST.BAT # the name of the batch file.
- ECHO OFF
- ECHO HI
- DIR/W
- PAUSE
- ENDBATCH
- test.bat NOSWAP # to run TEST.BAT without swapping
- # the script program to disk.
- ERASE test.bat # erase TEST.bat from disk, but retain
- END it in the script entry. Optionally use END
- to denote the end of the script entry.
-
- NOTE THAT ANY KIND OF TEXT OR ASCII FILE CAN BE STORED WITHIN
- A BATCH/ENDBATCH SET. Also, if you to setup a name like
- "CONFIG", the system will automatically add the ".BAT" to
- become "CONFIG.BAT" which may not be what you want. Either
- add a "." as in "CONFIG." or something like "CONFIG.CFG" to
- keep both you and the script interpreter happy.
-
-
- You can use the file creation feature to restrict access to
- information in files, by creating hard to access file names
- like "My test". You can create batch files with names like
- "MY TEST.BAT" but you may have difficulty running them. Use
- ALT-255 for the blank to generate such batch files that are
- designed to and will be run from the script but not by a user
- from the DOS command line. The BROWSE and ERASE can access
- such files, but the scheme does provide basic security.
-
- You may give all the encapsulated batch files the same name,
- with the understanding that each overwrites the previous (if
- it was not erased) when it is run. When they are run from the
- script the batch file name generated on disk matters only to
- the operating system and you do not need to gain meaning from
- unique names. Run a tool like (FFF) Fast File Find to find
- all the batch files on your drives, then consider the space
- and maintenance advantages from storing them in easily
- maintained, and possibly access restricted, script entries.
-
-
- Running TSR or resident programs from the script:
-
- Putting TSR programs in batch files, that also unload the
- TSR's after use is a simple way to temporarily run TSR's from
- the script. Many TSR's have built in command line switches
- that allow one to disable them. Use something like the
- MARK/RELEASE set on any others.
-
- # First, using /u to unload the TSR after use. BATCH TSR.BAT
- # a sample TSR batch file demo
-
-
-
-
- The Script Language Manual Page 4
-
- echo off
- sometsr
- sometsr /u ENDBATCH
-
- # Second, using mark/release. BATCH TSR.BAT mark sometsr
- release ENDBATCH
-
- See also ENDBATCH.
-
- BEEP beeps. See sound below.
-
- BROWSE indicates that you want to browse the file named on the
- same line. Use "BROWSE NOCLS" to avoid screen clearing.
-
- CD or CHDIR to change to the specified directory. You may
- change to restricted access directories like "\ WP\SEPT \
- MINE" with the blanks being generated using the ALT key and
- 255 on the numeric keypad. When access is via the script the
- extra burden of access via the DOS command line is missing and
- security is improved for a whole class of potential casual
- browsers. You may also use "CHDIR A:" to change to drive A:.
- This is designed as a simplification over DOS, and as an
- alternate to "A: NOSWAP"
-
- DELAY(seconds) to delay 1 or more seconds up to 65535. You
- may tap any key to continue instead of waiting for the delay
- time.
-
- DONE or END indicates the end of a set of script
- instructions. You may freely put comments after END or DONE.
-
- DOS_MENU switches the script to the DOS_MENU portion of the
- phone program.
-
- ECHO to echo an instruction on screen.
-
- END to stop the script program from looking for more
- instructions. The use of END is entirely optional unless you
- have your own notes following. Normal text will likely cause
- errors when the script trys to process it.
-
- ENDBATCH indicates the end of an encapsulated batch file.
-
- ENDLIST is used with GETLIST, see below.
-
- EQUIPMENT provides a simple equipment list. If you put a file
- or printer name on the same line, then the output is sent to
- the specified destination.
-
- ERASE to erase a disk file without prompting you.
-
- GET to get the script to prompt you for a parameter. Such as
- the file name for your word processor or spreadsheet to load
- up. You may change the help that pops up when you tap F1 when
- using a GET. Use GETTEXT for specific help for each separate
- GET. Add the keyword COMMAND when you want to have DOS's
-
-
-
-
- The Script Language Manual Page 5
-
- COMMAND.COM directly run whatever you input to the GET.
-
- GETTEXT is used to include help with the GET, see TEXT and the
- example below.
-
- Example:
- GETTEXT
- Provide the filename to be loaded into the word processor.
- ENDTEXT
- WordProc GET
- # or in a more generic form, where you provide the program name.
- COMMAND GET # Include the COMMAND command to indicate that you
- # want to have DOS run whatever you input.
- WP
-
- GETLIST is used to provide a list of parameters for the
- program to be run. Provide one set of parameters, up to 60
- characters long, per line. End the list with the command
- ENDLIST. You may include a suitable description of the list
- on the same line as the GETLIST command, and add notes after a
- # on the same line as individual entries. You may also
- add/change the help that pops up when you tap F1 at a
- GETLIST.
-
- Example:
-
- GETLIST Choose one of these files to load into the editor.
- newmail
- oldmail
- today.now # a runt.exe script file
- script.DOC
- *.prg # to edit the local xbase .prg files
- *.*
- ENDLIST
- # ENDLIST q # alternate format.
- clear # to pre clear the screen
- q # q for semware's qedit.
- # Use COMMAND to just run whatever it is.
-
- LOOP to tell the script program to go back and look some
- more.
-
- MACROS and the startup entry script. When the program first
- starts up it looks for the "SETUP" entry in the EVENTS filter
- field called SETUPMACRO. This entry is automatically executed
- when the TSPHONE program starts up to create the global macros
- and do any other setup procedures that you need done at that
- time. You can run any normal script or DOS commands in this
- SETUP entry. Yes, you may run CHKDSK, or other 'first thing
- in the morning' things, from this entry.
-
- Technical notes:
- The SETUP entry's FILTER field has the value "SETUPMACRO".
- The IDENTITY and PHONE entries' are described as "SETUP
- SETUP". The date is just "SETUP". The MESSAGE is "General
- configuration". You will notice the "SETUP SETUP" in the
-
-
-
-
- The Script Language Manual Page 6
-
- Session menu and in the EVENTS editing screen.
-
- FILTERs are described online and in the TSPHONE/OPMENU
- manuals. They allow you to manage or restrict your view of
- the system to a specifed subset by group or filter, including
- up to 5 groups.
-
- Macros
- The macros all use the $(MACRO) scheme used in the M4 macro
- language used by make tools. There are three forms of macro:
- global, local, and built-in.
-
- The description $(THISPART) portion of the macro can be up to
- 10 characters long, and the association action or replacement
- string can be up to 60 characters long.
-
- An example macro follows:
-
- MY_COLOR = Red, or maybe blue.
-
- $(MY_COLOR) would be replaced by "Red, or maybe blue." when it
- is found in an entry (without the surrounding ""). Check out
- the examples in the session menu or events edit area.
-
- If this MY_COLOR macro is placed in the SETUP entry it is a
- global macro. Up to 40 global macros macros can be setup in
- the SETUP entry. They will then remain in effect for use as
- $(MY_COLOR) in any other entry.
-
- If the the macro is created in any entry other than the SETUP
- entry, then it is one of up to 40 LOCAL macros that have
- effect only in the individual entry.
-
- The Built-in macros are designed for very common tasks and
- values that are stored in the general setup database
- GENSETUP.DBF.
-
-
- Built-in macros:
-
- $(DATE) expands to a date such as 14/06/93
- $(DAY) expands to the day of the month such as 14
- $(HOUR) expands to the hour of the day such as 14
- $(BAUD) expands to the supplied baud value as in 2400
- stored in the gensetup.dbf managed by GENMGR.exe.
- $(PHONENUM) expands to the supplied phone number.
- $(ANSWER) expands to the phone answer string stored
- in the gensetup.dbf managed by GENMGR.exe.
- $(HANGUP) expands to the phone hangup string stored
- in gensetup.dbf.
-
- You might also review the MODEM_XXX commands, such as
- MODEM_BAUD.
-
- The most common use for the $(DAY)$(HOUR) macros is automatic
- creation of backup files that change names daily and hourly.
-
-
-
-
- The Script Language Manual Page 7
-
- Running a script with "LHA U BACK$(DAY)$(HOUR) *.DBF" would
- tell the lha archive program to update/create a file called
- BACK1310.LZH from the local .DBF database files if it was run
- on the 13th day of the month at 10 AM. For example, the
- source code and documentation for TSPHONE is continually
- archived onto diskettes using such a scheme. It allows us to
- go back to a version for a certain day and hour to find
- something, or to recreate it when necessary.
-
-
- The MODEM_XXX commands actually contain the values matching
- the modem you selected in the modem database. They can be
- used inside a BATCH/ENDBATCH set.
- MODEM_BAUD the baud rate.
- MODEM_COMPRESS the compression string.
- MODEM_INIT the initialization string.
- MODEM_NAME the name or modem description.
- MODEM_PROTOCOL the protocol string.
-
- MKDIR to create a directory. Several subdirectories can be
- created at once as in "MKDIR \CHAP1\FIGURES\NEW". There is no
- matching RMDIR, use rmtree instead. Use ALT and 255 for any
- embedded blanks in the directory names, as in "MKDIR \HARD
- TO\GET\TO" as a mild form of security.
-
- NOCLS or NOCLEAR to suppress screen clearing before running.
- The script default is to clear the screen before running
- another program.
-
- NOSWAP to prevent swapping all but 2K of the script program to
- disk before running an external program. Swapping offers much
- more RAM for bigger applications. The current script default
- is to swap all but 2K of the script program to disk before
- running an external program.
-
- PASSWORD protection is only basically enabled in order to keep
- the program easier to use. However, adding a password in the
- Password field in the general setup entry for the script
- program will limit access to the script and inhibit user
- changes to the script entries. Naturally, knowledgeable Xbase
- users can step around this barrier in a few minutes. A
- PASSWORD keyword for the script language will be implemented
- upon sufficient user demand. See the PASSWORD section below.
-
- PAUSE or WAIT to wait after running a program. Use it just
- like a batch file pause, to allow review of the program's
- results. It is currently enabled as a user changeable long
- delay for interactive use, and 1 second when TSPHONE is run by
- another program to aid remote control of script entries. A
- true wait could wreck a whole night's automated operations.
- If you are creating a 'programmed' tutorial or demonstration
- use delay(seconds) instead of wait for more control.
-
- QUIT to quit or kill the script program. QUIT_TO some_exe to
- quit and run the next program without returning to the
- original program. You need to keep the program short; do not
-
-
-
-
- The Script Language Manual Page 8
-
- include the directory name. If you have to run the other
- program in a specific directory, then CD/CHDIR to that
- directory first.
-
- RAM to show the available free RAM memory at column 70, before
- any swapping. If you want to run a program called "RAM" add a
- WAIT on the same command line.
-
- REM or # for remarks.
-
- RUN to run an external program. NOSWAP implies a RUN without
- swapping. The script will default to swapping all but 2K of
- itself to disk when it "RUN"s a program. If you put "234" on
- a line by itself, the "RUN" is implied and any 234.exe or bat
- is run.
-
-
- TEXT when found on columns 1-4 (far left side) tells the
- script that you want to browse the contents of the entry, as
- an expansion on the help scheme for general usage. That is,
- instead of a program to run it becomes an on-line help area.
- The maximum line length should be less than 120 characters.
- A variant is GETTEXT that matchs the help to a particular
- GET. Replace the TEXT with GETTEXT and add your get just
- below it.
-
- TIME to display the time at column 70 on the screen. If you
- need to set the DOS TIME, either shell to DOS or add a WAIT on
- the same command line.
-
- WAIT to pause after running a program. TSPHONE starts up
- thinking a WAIT or PAUSE is 15 seconds, then reads in the
- general configuration/setup information from GENSETUP.DBF and
- changes its mind to suit those settings. Whenever TSPHONE is
- run by another program the WAIT time is automatically reduced
- to 1 second. This is based on the assumption that such
- automatic operations are not designed for user participation.
-
- $(whatever). M4 macro or MAKE language capability has
- restricted capability in this version. For full capability,
- use M4 or MAKE instead. Ask for a free copy of M4 or MAKE if
- needed.
-
- They are used as in $(PORT) as part of script entries.
-
-
- 4 XBASE language maintenance commands
-
- The XBASE commands work, as maintenance commands, on the
- internal EVENTS.DBF and EVENTS.DBT database system. They do
- exactly what the similar dBASE/Xbase commands do. However, if
- you use a dbf_DELETE command you should expect that entry to
- be deleted so you cannot continue to run that particular
- script. If you use dbf_ZAP, you clean out the database.
-
- The currently available database commands are:
-
-
-
-
- The Script Language Manual Page 9
-
- DBF_DELETE To delete the current entry.
-
- DBF_PACK To permanently remove previously deleted entries.
-
- DBF_RECALL To undelete previously deleted entries.
-
- DBF_RECCOUNT To display the number of entries.
-
- DBF_RECNO To display the current record/entry number.
-
- DBF_STRUCTURE To display the EVENTS.DBF file structure.
-
- DBF_ZAP To basically clean out the EVENTS database. If you
- have cleaned out the database, it might be useful to replace
- it with a copy from the original disks.
-
-
- 5 General notes and Warranty
-
- This manual is a sub-section of the main manual, to make it
- easier to use. Please use the main manual for for more
- information.
-
- THE DOCUMENTATION AND ASSOCIATED SOFTWARE ARE DISTRIBUTED AND
- SOLD WITH NO WARRANTIES, EITHER EXPRESS OR IMPLIED, REGARDING
- ITS MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE.
- THE INFORMATION IN THIS DOCUMENTATION IS SUBJECT TO CHANGE
- WITHOUT NOTICE AND DOES NOT REPRESENT A COMMITTMENT ON THE
- PART OF THE VENDOR.
-
- OTHER PRODUCT AND BRAND NAMES MENTIONED ARE TRADEMARKS OR
- REGISTERED TRADEMARKS OF THEIR RESPECTIVE HOLDERS.
- SPECIFICALLY XBASE IS THE GENERIC DATABASE INDUSTRY
- REPLACEMENT FOR THE REGISTERED TERM 'DBASE' OWNED BY BORLAND
- INTERNATIONAL.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-